home *** CD-ROM | disk | FTP | other *** search
- /* filp.c by Michael Hanson */
- /* you may use this, but not for profit, and give me credit */
- /* static int inchar; or more for a buffer, so don't need to read 1 ch
- at a time */
- putc(chr,filno)
- FILE filno;
- int chr;
- {
- #asm
- MOV BX,WORD [BP+6]
- MOV CX,01H
- LEA DX,[BP+4]
- MOV AH,40H
- INT 21H
- JB PERR
- CMP AX,1
- JNE PERR
- XOR AX,AX
- JMP PDON
- PERR: MOV AX,-1
- PDON:
- #
- }
-
- getc(filno)
- FILE filno;
- {
- #asm
- dseg
- INCHAR DW 0000H
- CSEG
- MOV BX,WORD [bp+4] ;get file handle
- MOV CX,01H
- MOV DX,OFFSET INCHAR
- MOV AH,3FH
- INT 21H
- JB ERR
- CMP AX,0
- JE ERR
- MOV AX,INCHAR
- JMP DONE
- ERR: MOV AX,-1H
- DONE:
- #
- }